package launch.helpers;

import java.io.File;
import java.util.List;
import java.util.ArrayList;

import provider.DbgData;
import provider.DbgDataProviderFactory;
import provider.DbgDataTool;


public class DbgLoginHelper {

    private final static DbgLoginHelper instance = new DbgLoginHelper();
    protected final List<String> ForbiddenName = new ArrayList<String>();

    public static DbgLoginHelper getInstance() {
	return instance;
    }

    protected DbgLoginHelper() {
	final DbgData nameData = DbgDataProviderFactory.getDataProvider(new File("wz/Etc.wz")).getData("ForbiddenName.img");
	for (final DbgData data : nameData.getChildren()) {
	    ForbiddenName.add(DbgDataTool.getString(data));
	}
    }

    public final boolean isForbiddenName(final String in) {
	for (final String name : ForbiddenName) {
	    if (in.contains(name)) {
		return true;
	    }
	}
	return false;
    }
}